package List;

import java.util.ArrayList;
import java.util.List;

public class SubListDemo {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<>();
        for (int i=0;i<100;i++){
            list.add(i*10);
        }
        System.out.println("集合"+list);
        List<Integer> subList=list.subList(3,8);//获取三到7的子集
        System.out.println("子集"+subList);
        for (int i=0;i<subList.size();i++){
            subList.set(i,subList.get(i)*10);
        }
        System.out.println("子集"+subList);
        System.out.println("原集合"+list);
        list.set(1,10000);
        System.out.println("修改后的集合"+list);
        subList.remove(0);
        System.out.println("子集"+subList);
        System.out.println("删除后的集合"+list);
        list.remove(2);
        System.out.println("修改后的集合"+list);
//        System.out.println("失灵的子集"+subList);








    }
}
